package com.candykingdom.pages
{
	import com.app.components.Button;
	import com.app.events.ControlEvent;
	import com.candykingdom.manage.Manage;
	import com.candykingdom.manage.PageNames;

	public class PageMenus extends PageBase
	{
		public function PageMenus()
		{
			super();
			for (var i:int=0;i<16;i++)
			{
				var button:Button = this.getChildByName("b"+(i+1)) as Button;
				button.addEventListener(ControlEvent.CLICK ,buttonClickHandler);
			}
		}
		
		private function buttonClickHandler(event:ControlEvent):void
		{
			switch(event.currentTarget.name)
			{
				case "b1":
					Manage.pageModel.pageName = PageNames.INTEGRAL;
					return;
					
				case "b2":
					Manage.pageModel.pageName = PageNames.EXCHANGE;
					return;
					
				case "b3":
					Manage.pageModel.pageName = PageNames.GIFT;
					return;
					
				case "b4":
					Manage.pageModel.pageName = PageNames.KINGDOM;
					return;
					
				case "b5":
					Manage.pageModel.pageName = PageNames.MALL;
					return;
					
				case "b6":
					Manage.pageModel.pageName = PageNames.ACTIVITY;
					return;
					
				case "b7":
					return;
					
				case "b8":
					Manage.pageModel.pageName = PageNames.RECORD;
					return;
					
				case "b9":
					Manage.pageModel.pageName = PageNames.COLLECT;
					return;
					
				case "b10":
					Manage.pageModel.pageName = PageNames.FAMILY;
					return;
					
				case "b11":
					return;
					
				case "b12":
					Manage.pageModel.pageName = PageNames.BULLETIN;
					return;
					
				case "b13":
					Manage.pageModel.pageName = PageNames.USER;
					return;
					
				case "b14":
					Manage.pageModel.pageName = PageNames.FAQ;
					return;
					
				case "b15":
					return;
					
				case "b16":
					Manage.pageModel.pageName = PageNames.ABOUT;
					return;
			}
		}
	}
}